import 'package:flutter/material.dart';


class XChartItem{

  String type;//类型: 折线图,普通柱状图,分组柱状图,叠加柱状图
  String? name;
  String? xAxisName;
  String? yAxisName;

  List<XChartItemData>? data;
  Color? color;
  double? width;
  List<Color>? linearGradientColors; //渐变颜色
  bool isLinearGradientColorLeftRight; //渐变是从左到右 还是上下

  List<Color>? borderLinearGradientColors; //渐变颜色
  Color? borderColor;
  double? borderWidth;

  XChartItem(
      {
        required this.type,
        required this.data,
        this.name,
        this.xAxisName,
        this.yAxisName,
        this.color,
        this.width,
        this.borderColor,
        this.borderWidth,
        this.linearGradientColors,
        this.borderLinearGradientColors,
        this.isLinearGradientColorLeftRight=true,
      }
      );


}

class XChartItemData{

  String? xText;
  num? xValue;  //num可以是int,double
  num y;

  dynamic otherData;

  XChartItemData(
      {
        required this.y,
        this.xText,
        this.xValue,
        this.otherData
      }
      );

}


class XCircularChartDataItem{

  String name;
  double value; //0~100
  String? showValue; //0~100
  Color? color;

  XCircularChartDataItem(
      {
        required this.name,
        required this.value,
        this.color,
        this.showValue,
      }
      );
}